package cn.zwx.common.rocket.producer.runner;

import cn.zwx.common.rocket.producer.service.TransactionMqProducerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author zhangwenxue
 * <code>
 *     如果是事务消息需要此类 无事务消息不需要此类
 * </code>
 */
@Component
public class ProducerRunner implements CommandLineRunner {

    public static final Logger logger = LoggerFactory.getLogger(ProducerRunner.class);

    @Resource
    private TransactionMqProducerService transactionMqProducerService;


    @Override
    public void run(String... args) {
        transactionMqProducerService.start();
        logger.info("transactionMqProducerService running success!!");
    }
}
